package com.zbkj.service.service;

import com.github.pagehelper.PageInfo;
import com.zbkj.common.model.admin.SystemAdmin;
import com.zbkj.common.request.*;
import com.zbkj.common.model.agent.CommunityBrokerage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.common.response.*;

import java.util.List;
/**
* @author Caiyc
* @description CommunityBrokerageService 接口
* @date 2025-07-21
*/
public interface CommunityBrokerageService extends IService<CommunityBrokerage> {

    Boolean create(CommunityBrokerageSaveRequest communityBrokerageSaveRequest);

    /**
     * 分页查询小区分佣设置表
     * @param request 查询条件
     * @param pageParamRequest 分页对行
     * @return 查询结果
     */
    List<MerchantBrokeragePageDataResponse> getList(MerchantBrokerageSearchRequest request, PageParamRequest pageParamRequest);

    /**
    * 修改小区分佣设置表
    * @param communityBrokerageRequest
    * @return
    */
    boolean update(CommunityBrokerageSaveRequest communityBrokerageRequest);
    boolean updateByMerchant(MerchantBrokerageSaveRequest communityBrokerageRequest);

    /**
    * 批量删除
    * @param idList
    * @return
    */
    boolean batchDelete(List<Integer> idList);

    /**
    * 查询溯源套餐表详情
    * @param id
    * @return
    */
    CommunityBrokerageDetailResponse getDetails(Integer id);
    MerchantBrokerageDetailResponse getDetailsByMerchant(Integer id);

    /**
     * 通过经纬度查询小区列表
     * @param request
     * @return
     */
    List<CommunityListResponse> getCommunityList(CommunityListParamRequest request);

    MerchantBrokerageConfigInfoResponse getInfo(SystemAdmin systemAdmin, Integer id);

    boolean updateConfig(MerchantBrokerageConfigInfoRequest request, SystemAdmin systemAdmin);

    CommunityBrokerage getByMerId(Integer merId);

    List<CommunityBrokerage> getCommunityList();

    PageInfo<MerchantBrokerageConfigPageDataResponse> getListMerchant(MerchantBrokerageConfigSearchRequest request, PageParamRequest pageParamRequest);

    boolean delete(Integer id);

    /**
     * 查询最新一个启用状态的商户分红设置
     * @param id
     * @param brandId
     * @return
     */
    CommunityBrokerage getLatestConfig(Integer id, Integer brandId);

    CommunityBrokerage getLatestConfigByCommunity(Integer communityId);

    CommunityBrokerage getMerchantBrokerageRate(Integer merId);
}